{switch name="type"}
    {case value="text"}
        <table class="table table-bordered">
            <tr>
                <td width="120">文本框长度</td>
                <td><input type="text" class="input-text" size="5" name="setup[size]" value="{$size}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td> <input type="text" class="input-text" size="50"  name="setup[default]" value="{$default}" /></td>
            </tr>
            <tr>
                <td>是否为密码框</td>
                <td>
                    <input type="radio" name="setup[ispassword]" value="1" {if condition="$ispassword==1"} checked{/if}> 是
                    <input type="radio" name="setup[ispassword]" value="0" {if condition="$ispassword==0"} checked{/if}> 否
                </td>
            </tr>
            <input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/>
        </table>
    {/case}
    {case value="textarea"}
        <table class="table table-bordered">
            <tr>
                <td>字段类型</td>
                <td>
                    <select class="form-control" name="setup[fieldtype]">
                    <option value="mediumtext" <?php if($fieldtype=='mediumtext') echo 'selected';?>>MEDIUMTEXT</option>
                    <option value="text" <?php if($fieldtype=='text') echo 'selected';?>>TEXT</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="120">文本域行数</td>
                <td><input type="text"  class="form-control" size="5" name="setup[rows]" value="{$rows}" /></td>
            </tr>
            <tr>
                <td>文本域列数</td>
                <td>
                    <input type="text"  class="form-control" size="5" name="setup[cols]" value="{$cols}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td><textarea  name="setup[default]" rows="3" cols="40">{$default}</textarea></td>
            </tr>
        </table>
    {/case}
    {case value="select"}
        <table class="table table-bordered">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td><textarea  name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea></td>
            </tr>
            <tr>
                <td>选项类型</td>
                <td>
                    <input type="radio" name="setup[multiple]" value="0" {if condition="$multiple==0"} checked{/if}> 下拉框
                    <input type="radio" name="setup[multiple]" value="0" {if condition="$multiple==1"} checked{/if}> 多选列表框
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
                    <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                    <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                    <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                    <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                    <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                    </select>
                    <span id="numbertype" style="display:none;"  >
                        <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数
                    </span>
                </td>
            </tr>
            <tr>
                <td>可见选项的数目</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" />
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" class="form-control" size="5"  name="setup[default]" value="{$default}" />
                </td>
            </tr>
        </table>
    {/case}

    {case value="groupid"}
        <table class="table table-bordered">
            <tr>
                <td width="120">选项类型</td>
                <td>
                    <input type="radio" name="setup[inputtype]" value="checkbox" {if condition="$inputtype=='checkbox'"} checked{/if}> 复选框
                    <input type="radio" name="setup[inputtype]" value="select" {if condition="$inputtype=='select'"} checked{/if}> 下拉列表框
                    <input type="radio" name="setup[inputtype]" value="radio" {if condition="$inputtype=='radio'"} checked{/if}> 单选框
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
                <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                </select>
                    <span id="numbertype" style="display:none;"  >
                        <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数
                    </span>
                </td>
            </tr>
            <tr>
                <td>复选框或单选框时宽度</td>
                <td>
                    <input type="text" class="form-control" size="10"  name="setup[labelwidth]" value="{$labelwidth}" />
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td> <input type="text" class="form-control" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>
    {/case}

    {case value="typeid"}
        <table cellpadding="2" cellspacing="1" width="100%">
            <tr>
                <td width="120">选项类型</td>
                <td>
                    <input type="radio" name="setup[inputtype]" value="checkbox" {if condition="$inputtype=='checkbox'"} checked{/if}> 复选框
                    <input type="radio" name="setup[inputtype]" value="select" {if condition="$inputtype=='select'"} checked{/if}> 下拉列表框
                    <input type="radio" name="setup[inputtype]" value="radio" {if condition="$inputtype=='radio'"} checked{/if}> 单选框
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select name="setup[fieldtype]"  onchange="javascript:numbertype(this.value);">
                    <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                    <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                    <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                    </select>
                    <span id="numbertype" style="display:none;"  >
                        <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数
                    </span>
                </td>
            </tr>
            <tr>
                <td>复选框或单选框时宽度</td>
                <td>
                    <input type="text" class="form-control" size="10"  name="setup[labelwidth]" value="{$labelwidth}" />
                </td>
            </tr>
            <tr>
                <td>顶级类别ID</td>
                <td> <input type="text" class="form-control" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>
    {/case}

    {case value="radio"}
        <table class="table table-bordered">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td>
                    <textarea class="form-control" name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea>
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select class="form-control" name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
                    <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                    <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                    <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                    <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                    <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                    </select>
                    <span id="numbertype" style="display:none;">
                        <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数
                    </span>
                </td>
            </tr>
            <tr>
                <td>宽度</td>
                <td>
                    <input type="text" class="form-control" size="10" name="setup[labelwidth]" value="{$labelwidth}" />
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[default]" value="{$default}" />
                </td>
            </tr>
        </table>
    {/case}

    {case value="checkbox"}
        <table class="table table-bordered">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td>
                    <textarea class="form-control" name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea>
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select class="form-control" name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
                    <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                    <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                    <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                    <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                    <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                    </select> <span id="numbertype" style="display:none;"  >
                    <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数</span>
                </td>
            </tr>
            <tr>
                <td>宽度</td>
                <td>
                    <input type="text" class="form-control" size="10" name="setup[labelwidth]" value="{$labelwidth}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[default]" value="{$default}" />
                </td>
            </tr>
        </table>
    {/case}

    {case value="number"}
        <table class="table table-bordered">
            <tr>
                <td width="120">文本框长度</td>
                <td>
                    <input type="text" class="input-text" size="5" name="setup[size]" value="{$size}" />
                </td>
            </tr>
            <tr>
                <td>是否包括负数：</td>
                <td>
                    <input type="checkbox" name="setup[numbertype]" value="1" checked />不包括负数</td>
            </tr>
            <tr>
                <td>小数位数：</td>
                <td>
                    <select class="form-control" name="setup[decimaldigits]">
                    <option value="0"<?php if($decimaldigits==0) echo ' selected';?>>0</option>
                    <option value="1"<?php if($decimaldigits==1) echo ' selected';?>>1</option>
                    <option value="2"<?php if($decimaldigits==2) echo ' selected';?>>2</option>
                    <option value="3"<?php if($decimaldigits==3) echo ' selected';?>>3</option>
                    <option value="4"<?php if($decimaldigits==4) echo ' selected';?>>4</option>
                    <option value="5"<?php if($decimaldigits==5) echo ' selected';?>>5</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" name="setup[default]" value="{$default}" size="40" class="input-text">
                </td>
            </tr>
        </table>
    {/case}
    {case value="verify"}
         <table class="table table-bordered">
            <tr>
                <td width="120">文本框长度</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" />
                </td>
            </tr>
        </table>
    {/case}

    {default /}
{/switch}

<script>
    function numbertype(fieldtype){

        if(fieldtype=='varchar'){
            $('#numbertype').hide();
        }else{
            $('#numbertype').show();
        }
    }
    {if condition="!empty($fieldtype) && $fieldtype!='varchar'"}$('#numbertype').show();{/if}
</script>
